package com.oocl.admin_platform.util;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

public class Config {
	private static Logger logger=Logger.getLogger(Config.class);
	
	public static void config(ServletContext context) throws FileNotFoundException, IOException{
		Properties p = new Properties();
		String path = context.getRealPath("/");
		p.load(new FileInputStream(path + "/WEB-INF/classes/config.properties"));
		int index = 0;
		for(Object k:p.keySet()){
			String key = (String) k;
			String value = p.getProperty(key);
			context.setAttribute(key, value);
			index++;
		}
		logger.info("ServletContext" + index);
		
	}
	
	
	
	
}
